package com.av.bcacc.myapidemo.provider;

import com.av.bcacc.myapidemo.R;
import com.av.bcacc.myapidemo.base.BaseReclyerviewHolder;
import com.av.bcacc.myapidemo.base.BaseReclyerviewPagerAdapter;
import com.av.bcacc.myapidemo.databinding.ProviderItemBinding;

import java.util.List;

public class ProviderAdapter extends BaseReclyerviewPagerAdapter<User, ProviderItemBinding> {


    public ProviderAdapter(List data) {
        super(data);
    }

    @Override
    public int getLayoutId() {
        return R.layout.provider_item;
    }

    @Override
    public void onBindRecyclerVeiwHolder(BaseReclyerviewHolder h, int p) {
        ProviderItemBinding providerItemBinding = (ProviderItemBinding) h.getItemBinder();
        User userItem = getData().get(p);
        providerItemBinding.name.setText(userItem.name);
        providerItemBinding.addressTv.setText(userItem.address);
        providerItemBinding.ageTv.setText(userItem.age+"");
    }
}
